home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hráč 2005 January
/
Hrac_76_2005-01_dvd.iso
/
lokalizacie
/
Medal Of Honor Allied Assault
/
mohaa10cz.exe
/
{app}
/
main
/
Pak10.pk3
/
Global
/
items.scr
< prev
next >
Wrap
Text File
|
2002-03-23
|
12KB
|
502 lines
////////////////////////////////////////////////////////////////////////////////////////
//
// MoH: Allied Assault Script File
// Global function: For giving items and placing item icons on the HUD
// Script Written By: Benson 'elmagoo' Russell
//
////////////////////////////////////////////////////////////////////////////////////////
//**************************************************************************
//*** add items to inventory
//*** this will put an item into the players inventory
//*** syntax --------------------------------
//*** add_item <item>
//**************************************************************************
add_item local.passed_item local.nomessage:
//*** check to see if the counter has been initialized
if (level.item_total == NIL)
{
level.item_total = 0
}
//*** check to see if there are already 6 items in the inventory
if (level.item_total >= 6)
{
println "^~^~^ Can't have more than 6 items in player's inventory!!"
goto add_item_end
}
//*** assign the proper graphic for the item
switch (local.passed_item)
{
case "camera":
local.item_graphic = "textures/hud/item_camera"
local.item = "camera"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi spionazni fotoaparat!"
}
$player item models/items/camera.tik
break
case "binoculars":
local.item_graphic = "textures/hud/item_binoculars"
local.pickup_sound = "pickup_explosives"
local.item = "binoculars"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi dalekohled!"
}
$player item models/items/binoculars.tik
break
case "bangalores":
local.item_graphic = "textures/hud/item_bangalore"
local.pickup_sound = "pickup_bangalore"
local.item = "bangalores"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi dlouhou naloz!"
}
break
case "battery":
local.item_graphic = "textures/hud/item_battery"
local.item = "battery"
if (local.nomessage == NIL)
{
iprintln "Zskal jsi baterii!"
}
break
case "clipboard":
local.item_graphic = "textures/hud/item_clipboard"
//local.pickup_sound = "pickup_clipboard"
local.pickup_sound = "pickup_papers"
local.item = "clipboard"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi prohlaseni!"
}
break
case "radar_blueprints":
local.item_graphic = "textures/hud/item_radar_blueprints"
local.pickup_sound = "pickup_papers"
local.item = "radar_blueprints"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi tiskopis o radaru Naxos!"
}
break
case "radar_notes":
local.item_graphic = "textures/hud/item_radar_notes"
local.pickup_sound = "pickup_papers"
local.item = "radar_notes"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi poznamky o vyzkumu radaru Naxos!"
}
break
case "uboat_blueprints":
local.item_graphic = "textures/hud/item_uboat_blueprints"
local.pickup_sound = "pickup_papers"
local.item = "uboat_blueprints"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi tiskopisy o ponorce Naxos!"
}
break
case "uboat_notes":
local.item_graphic = "textures/hud/item_uboat_notes"
local.pickup_sound = "pickup_papers"
local.item = "uboat_notes"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi poznamky vyzkumu o ponorce Naxos!"
}
break
case "explosive":
local.item = "explosive"
case "explosives":
local.item_graphic = "textures/hud/item_explosive"
local.pickup_sound = "pickup_explosives"
if (local.item == NIL)
{
local.item = "explosives"
}
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi naloze!"
}
break
case "radio_explosives":
local.item_graphic = "textures/hud/item_radio_explosive"
local.pickup_sound = "pickup_explosives"
if (local.item == NIL)
{
local.item = "radio_explosives"
}
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi vybusne radiove naloze!"
}
break
case "gasmask":
local.item_graphic = "textures/hud/item_gasmask"
local.pickup_sound = "pickup_gasmask"
local.item = "gasmask"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi plynovou masku!"
}
break
case "papers_level1":
local.item_graphic = "textures/hud/item_papers1"
local.pickup_sound = "pickup_papers"
local.item = "papers_level1"
$player item models/items/papers.tik
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi dokumenty 1 stupne!"
}
level.papers = 1
break
case "papers_level2":
local.item_graphic = "textures/hud/item_papers2"
local.pickup_sound = "pickup_papers"
local.item = "papers_level2"
$player item models/items/papers2.tik
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi dokumenty 2 stupne!"
}
level.papers = 2
break
case "wirecutters":
local.item = "wirecutters"
case "wirecutter":
local.item = "wirecutter"
case "cutters":
local.item = "cutters"
case "cutter":
local.item_graphic = "textures/hud/item_wirecutters"
if (local.item == NIL)
{
local.item = "cutter"
}
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi nuzky na drat!"
}
break
case "radio":
local.item_graphic = "textures/hud/item_radio"
local.pickup_sound = "m3l2_radio_pickup"
local.item = "radio"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi radio!"
}
break
case "uniform":
local.item_graphic = "textures/hud/item_uniform"
local.pickup_sound = "pickup_uniform"
local.item = "uniform"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi Nemeckou dustojnickou uniformu!"
}
$player.has_disguise = 1
setcvar g_playermodel "german_waffenss_officer"
break
case "stg44_blueprints":
local.item_graphic = "textures/hud/item_stg44_blueprints"
local.pickup_sound = "pickup_papers"
local.item = "stg44_blueprints"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi tiskopis o StG44!"
}
break
case "tigerii_manual":
local.item_graphic = "textures/hud/item_tigerii_manual"
local.pickup_sound = "pickup_papers"
local.item = "tigerii_manual"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi prirucku k tanku King Tiger!"
}
break
case "battleplans":
local.item_graphic = "textures/hud/item_battleplans"
local.pickup_sound = "pickup_papers"
local.item = "battleplans"
if (local.nomessage == NIL)
{
iprintln "Ziskal jsi Nemecke bojove plany!"
}
break
//*** the default is selected if the scripter enter a non-valid item
default:
println "^~^~^ " local.item " is not a valid inventory item!!"
goto add_item_end
break
}
//*** up the item total counter
level.item_total += 1
//*** shuffle the inventory items down 1 slot each
for (local.i = level.item_total ; local.i > 1 ; local.i --)
{
level.item_graphic[local.i] = level.item_graphic[(local.i - 1)]
level.item[local.i] = level.item[(local.i - 1)]
huddraw_shader (local.i + 20) level.item_graphic[local.i]
}
//*** add the new item
level.item_graphic[1] = local.item_graphic
level.item[1] = local.item
huddraw_shader 21 level.item_graphic[1]
//*** play the proper sound
if (local.pickup_sound != NIL)
{
$player playsound local.pickup_sound
}
//*** draw the items on the screen
thread draw_items
add_item_end:
end
//**************************************************************************
//*** remove items from inventory
//*** this will remove an item from the players inventory
//*** syntax --------------------------------
//*** remove_item <item>
//**************************************************************************
remove_item local.item:
//*** check to see if the counter has been initialized
if (level.item_total == NIL)
{
level.item_total = 0
}
//*** if the inventory is already empty, exit
if(level.item_total <= 0)
{
println "^~^~^ There are no items currently in the players inventory!!"
goto remove_item_end
}
for (local.i = 1 ; local.i <= 6 ; local.i ++)
{
if (level.item[local.i] == local.item)
{
local.index = local.i
goto remove_item_remove
}
}
//*** if the item isn't in the players inventory tell the scripter
println "^~^~^ " local.item " can not be removed, it is not in the players inventory!!"
goto remove_item_end
//*** remove the item and shuffle the remaining inventory down a slot
remove_item_remove:
//*** check to see if it's a useable item that needs removing
if (local.item == "camera")
{
$player take models/items/camera.tik
}
else if (local.item == "binoculars")
{
$player take models/items/binoculars.tik
}
else if (local.item == "papers_level1")
{
$player take models/items/papers.tik
level.papers = 0
}
else if (local.item == "papers_level2")
{
$player take models/items/papers2.tik
level.papers = 0
}
else if (local.item == "uniform")
{
setcvar g_playermodel "american_army"
$player.has_disguise = 0
}
//*** remove the item and shuffle the rest down a slot
for (local.j = local.index ; local.j < level.item_total ; local.j ++)
{
level.item_graphic[local.j] = level.item_graphic[(local.j + 1)]
level.item[local.j] = level.item[(local.j + 1)]
huddraw_shader (local.j + 20) level.item_graphic[local.j]
level.item_graphic[(local.j + 1)] = ""
level.item[(local.j + 1)] = ""
}
level.item_total -= 1
//*** draw the items on the screen
thread draw_items
remove_item_end:
end
//************************************************
// draw the item icons
//************************************************
draw_items:
//*** variables to base the position off of, positions for all the item slots
/*
local.xpos = -192
local.ypos = 40
*/
local.xpos = -384
local.ypos = 8
huddraw_align 21 right top
huddraw_align 22 right top
huddraw_align 23 right top
huddraw_align 24 right top
huddraw_align 25 right top
huddraw_align 26 right top
/*
huddraw_rect 21 local.xpos local.ypos 30 30
huddraw_rect 22 (local.xpos + 35) local.ypos 30 30
huddraw_rect 23 (local.xpos + 70) local.ypos 30 30
huddraw_rect 24 (local.xpos + 105) local.ypos 30 30
huddraw_rect 25 (local.xpos + 140) local.ypos 30 30
huddraw_rect 26 (local.xpos + 175) local.ypos 30 30
*/
/*
huddraw_rect 21 local.xpos local.ypos 64 64
huddraw_rect 22 (local.xpos + 70) local.ypos 64 64
huddraw_rect 23 (local.xpos + 140) local.ypos 64 64
huddraw_rect 24 (local.xpos + 210) local.ypos 64 64
huddraw_rect 25 (local.xpos + 280) local.ypos 64 64
huddraw_rect 26 (local.xpos + 350) local.ypos 64 64
*/
//*** draw the items on the hud
for (local.j = 1 ; local.j <= 6 ; local.j ++)
{
local.xpos = -70 * local.j - 8
huddraw_rect (local.j + 20) local.xpos local.ypos 64 64
if (local.j > level.item_total)
{
huddraw_alpha (local.j + 20) 0
goto draw_item_next
}
huddraw_alpha (local.j + 20) 0.7
draw_item_next:
}
end
//************************************************
// reload all the item slots
//************************************************
reload_items:
waitthread blank_items
for (local.i = 1 ; local.i <= 6 ; local.i ++)
{
huddraw_shader (local.i + 20) level.item_graphic[local.i]
}
thread draw_items
end
//************************************************
// blank all the item slots
//************************************************
blank_items:
huddraw_alpha 21 0
huddraw_alpha 22 0
huddraw_alpha 23 0
huddraw_alpha 24 0
huddraw_alpha 25 0
huddraw_alpha 26 0
end